Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix fiat values in testnet visibility #26273

Conversation

OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Aug 1, 2024

Description

This PR goal is to fix visibility issue of viat values in testnet. For more info please visit task here #24945

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Turn off "Show conversion on test networks" setting in Advanced Settings
  2. Use L2 test network (Arbitrum Sepolia could be added from here https://chainlist.org/chain/421614)
  3. Go to test dapp
  4. Click on "Create a token"
  5. Observe fiat value is hidden (it was shown before)

Screenshots/Recordings

Before

Screenshot 2024-08-01 at 11 43 58

After

Screenshot 2024-08-01 at 11 44 05

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@OGPoyraz OGPoyraz requested review from a team as code owners August 1, 2024 10:32
@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Aug 1, 2024
Copy link

sonarcloud bot commented Aug 1, 2024

…spite-show-conversion-on-test-networks-advanced-settings-being-disabled
@@ -168,18 +173,15 @@ export default function FeeDetailsComponent({
{t('layer1Fees')}
</Text>
}
detailText={
useCurrencyRateCheck && renderTotalDetailText(layer1GasFee)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useCurrencyRateCheck is already checked in getShouldShowFiat selector hence am removing this.

tag: 'div',
});
await driver.clickElement({ text: 'Fiat', tag: 'label' });
// We now need to enable "Show fiat on testnet" if we are using testnets (and since our custom
Copy link
Member Author

@OGPoyraz OGPoyraz Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect, 0x539 (the network used for e2e tests) is not testnet and not in the testnet list (See here https://github.com/MetaMask/metamask-extension/blob/24945-bug-fiat-values-continue-to-show-despite-show-conversion-on-test-networks-advanced-settings-being-disabled/shared/constants/network.ts#L1033)

0x539 is also not custom network (See getIsCustomNetwork function here https://github.com/MetaMask/metamask-extension/blob/24945-bug-fiat-values-continue-to-show-despite-show-conversion-on-test-networks-advanced-settings-being-disabled/ui/selectors/selectors.js#L2372)

Since this PR's aim is to correct previous getShouldShowFiat selector, this means that this e2e test must toggle useCurrencyRateCheck to make it work, and it's done via withConversionRate Enabled/Disabled fixture.

@OGPoyraz OGPoyraz marked this pull request as draft September 3, 2024 13:33
Copy link

codecov bot commented Sep 3, 2024

Codecov Report

Attention: Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 69.95%. Comparing base (ca6fd53) to head (b3f44ac).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
...nts/fee-details-component/fee-details-component.js 85.71% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #26273      +/-   ##
===========================================
- Coverage    69.96%   69.95%   -0.00%     
===========================================
  Files         1442     1441       -1     
  Lines        50100    50098       -2     
  Branches     14006    14007       +1     
===========================================
- Hits         35049    35046       -3     
- Misses       15051    15052       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [114e26f]
Page Load Metrics (1834 ± 100 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint21524481658508244
domContentLoaded16182378181420096
load162924501834208100
domInteractive127941189
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: -686 Bytes (-0.01%)
  • common: 118 Bytes (0.00%)

@OGPoyraz OGPoyraz marked this pull request as ready for review September 4, 2024 07:27
OGPoyraz and others added 2 commits September 5, 2024 10:11
…spite-show-conversion-on-test-networks-advanced-settings-being-disabled
…spite-show-conversion-on-test-networks-advanced-settings-being-disabled
Copy link
Contributor

github-actions bot commented Sep 6, 2024

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

matthewwalsh0
matthewwalsh0 previously approved these changes Sep 6, 2024
…spite-show-conversion-on-test-networks-advanced-settings-being-disabled
…spite-show-conversion-on-test-networks-advanced-settings-being-disabled
…spite-show-conversion-on-test-networks-advanced-settings-being-disabled
…spite-show-conversion-on-test-networks-advanced-settings-being-disabled
…spite-show-conversion-on-test-networks-advanced-settings-being-disabled
…spite-show-conversion-on-test-networks-advanced-settings-being-disabled
…spite-show-conversion-on-test-networks-advanced-settings-being-disabled
…spite-show-conversion-on-test-networks-advanced-settings-being-disabled
Copy link

sonarcloud bot commented Sep 16, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [b3f44ac]
Page Load Metrics (1697 ± 69 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint24320461618344165
domContentLoaded14581989167914871
load14671994169714469
domInteractive219634199
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: -686 Bytes (-0.01%)
  • common: 64 Bytes (0.00%)

@OGPoyraz OGPoyraz merged commit e048a93 into develop Sep 16, 2024
78 checks passed
@OGPoyraz OGPoyraz deleted the 24945-bug-fiat-values-continue-to-show-despite-show-conversion-on-test-networks-advanced-settings-being-disabled branch September 16, 2024 12:52
@github-actions github-actions bot locked and limited conversation to collaborators Sep 16, 2024
@metamaskbot metamaskbot added the release-12.6.0 Issue or pull request that will be included in release 12.6.0 label Sep 16, 2024
@metamaskbot metamaskbot added release-12.5.0 Issue or pull request that will be included in release 12.5.0 and removed release-12.6.0 Issue or pull request that will be included in release 12.6.0 labels Sep 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.5.0 Issue or pull request that will be included in release 12.5.0 team-confirmations Push issues to confirmations team
Projects
None yet
5 participants